﻿function initPublicMaster() {
    cms.Dialogs.RenderAlerts();
    var selectLocalization = document.getElementById("selectLocalization");
    var mainBox = document.getElementById("mainBox");
    iLib.Dom.AddListener(selectLocalization, "click", function(e) {
        e = e || window.event;
        var target = e.target || e.srcElement;
        iLib.Dom.PreventBubble(e);
        cms.Lists.ShowPopup(document.getElementById("ctl00_pnlLocales"), target, "right", iLib.Pos.FindX(mainBox) + 3, iLib.Pos.FindY(mainBox) + 2, true, e);
    });
}

try {
    if (!HTMLAnchorElement.prototype.click) {
        HTMLAnchorElement.prototype.click = function() {
            var evt = document.createEvent('MouseEvents');
            evt.initEvent('click', true, true);
            if (this.dispatchEvent(evt) !== false)
                document.location.href = this.href;
        }
    }
}
catch (err) {
}

iLib.Dom.AddListener(window, "load", initPublicMaster);
